package com.sk.bilibili.adapter.pager;

import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;

import com.sk.bilibili.bean.Type;

import java.util.List;
import java.util.stream.Collectors;

public abstract class BaseTypeFragmentAdapter extends BaseFragmentAdapter {

    protected List<Type> types;

    public BaseTypeFragmentAdapter(@NonNull FragmentManager fm, List<Type> types) {
        super(fm);
        this.types=types;
        initData();
    }

    @Override
    protected String[] getTitles() {
        return types.stream().map(Type::getTitle).collect(Collectors.toList()).toArray(new String[0]);
    }

}